import mplfinance as mpf
import pandas as pd
from loguru import logger


def plot(df: pd):
    plot_kwargs = dict(mav=(5, 20, 60), volume=True, figratio=(10, 8), figscale=0.75)
    if isinstance(df, pd.DataFrame):
        mpf.plot(df, **plot_kwargs)
    else:
        logger.error("type error: expected DataFrame, got {}", type(df))


def plot_renko(df: pd):
    renko_kwargs = dict(type='renko', mav=(5, 20, 60), volume=True, figratio=(10, 8), figscale=0.75)
    if isinstance(df, pd.DataFrame):
        mpf.plot(df, **renko_kwargs)
    else:
        logger.error("type error: expected DataFrame, got {}", type(df))
